#! /bin/bash
mic="alsa_input.usb-0c76_USB_PnP_Audio_Device-00.mono-fallback"
output="alsa_output.usb-0c76_USB_PnP_Audio_Device-00.analog-stereo"

menu=$(zenity --width 120 --height 320 --list \
  --title="Share Audio To other app" \
  --column 'Option'\
    On\
    Off)

case $menu in
    "On")
        pactl load-module module-null-sink sink_name=Virtual1
        pactl load-module module-loopback source=$mic sink=Virtual1
        pactl load-module module-loopback source=Virtual1.monitor sink=$output
    ;;

    "Off")
        pulseaudio --kill
        pulseaudio --start --system=true --daemonize=true
    ;;
esac
